package com.xt.base.dao.hibernate.code;

import org.jconfig.Configuration;
import org.jconfig.ConfigurationManager;
import org.jconfig.ConfigurationManagerException;

/**
 * 类说明: 业务参数类,由一个配置文件持入化(AffairParameter_config.xml)<br>
 * 
 */
public class AffairParameter {

	/** true:使用 false:不使用 */
	private boolean useLock;
	
	/** 用于系统编码的生成 */
	private String serverCode;
	
	private static AffairParameter affairParameter = new AffairParameter();

	private Configuration config = ConfigurationManager
			.getConfiguration("AffairParameter");

	

	private AffairParameter()  {	
		useLock = config.getBooleanProperty("isUseLock", true);
		serverCode= config.getProperty("serverCode", "XT888");
	
	}

	public static AffairParameter getInstance() {
		return affairParameter;
	}

	public void updateAffairParameter() throws ConfigurationManagerException {
		ConfigurationManager.getInstance().save(config.getConfigName());
	}

	public String getServercode() {
		return serverCode;
	}

	public boolean isUseLock() {
		return useLock;
	}
}